package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.asiainfo.ysrman.doprocess.*;
import com.asiainfo.ysrman.Beans.*;
import java.util.*;

public final class ub_005flist_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=GBK");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
 
	ArrayList al = new ArrayList();
    String mobile = "";
    String via = "2";
    int allcount = 0;
    String pageUrlStr = "";
    
    if ( session.getAttribute("mobile") != null )
	{	   
	    mobile = session.getAttribute("mobile").toString();	   
	    session.getAttribute("muFlag").toString();	
	   
		if ( mobile != null && !mobile.equals("") )	
		{
			String pageIndexStr = request.getParameter("pageIndex");
		 	if (pageIndexStr==null || pageIndexStr.trim().equals(""))
		 	{
		 		pageIndexStr = "1";
		 	}
		 	int pageIndex = Integer.parseInt(pageIndexStr);
		 	int pageNum = 20;
		 	int urlNum = 15;	//显示页码数量
		 	
		 	YsrProcess yprocess = new YsrProcess();
		 	
		 	int listNum = 1;		 	
		    listNum = yprocess.getUserUBNum(mobile,"");
			
			int pageCount = listNum / pageNum + ((listNum % pageNum == 0) ? 0 : 1);
			
			int lowerNum = pageIndex - 7;
			int upperNum = pageIndex + 7;


			if (upperNum > pageCount)
			{
				lowerNum = lowerNum - (upperNum - pageCount);
				upperNum = pageCount;
			}
			else if(upperNum < urlNum)
			{
				upperNum = urlNum;
			}
			
			if (lowerNum <= 0)
				lowerNum = 1;	
			
			StringBuffer sb = new StringBuffer(" ");
			sb.append("共有" + listNum + "条记录&nbsp;&nbsp;<a href='ub_list.jsp?pageIndex=1'><u><font size = 2>首页</font></u></a> ");
			for(int num = lowerNum;num<=upperNum;num++)
			{
				if(num != pageIndex)
				{
					sb.append("<a href='ub_list.jsp?pageIndex="+num+"'>"+ num + "</a> ");				
				}
				else
				{
					sb.append("<a href='ub_list.jsp?pageIndex="+num+"'><font color='red'>"+ num + "</font></a> ");
				}

				if(num>=pageIndex+urlNum-1 || num>=pageCount)
					break;
			}
			sb.append("<a href='ub_list.jsp?pageIndex="+pageCount+"'><u><font size = 2>尾页</font></u></a>");
			
			if (lowerNum != upperNum)
				pageUrlStr = sb.toString();
			
			al =  yprocess.getUserUB(mobile,"",pageIndex,pageNum); 
		}
		else
		{
			al = null;
			out.println("<script language=\"javaScript\">alert(\"请您登陆后查询,谢谢!\");</script>");
			response.sendRedirect("p_index.jsp");
		}
	}
	else
	{
		al = null;
		out.println("<script language=\"javaScript\">alert(\"请您登陆后查询,谢谢!\");</script>");
		response.sendRedirect("p_index.jsp");
	}
   
    
    if (al != null && al.size()>0 )
    {
    	
    	UserInfo user = (UserInfo)al.get(al.size()-1);
    	allcount = user.getAllCount();
    }

      out.write("\r\n");
      out.write("\r\n");
      out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n");
      out.write("<head>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\" />\r\n");
      out.write("<title>大集兑活动专区-查询</title>\r\n");
      out.write("<style type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write("body,td,th {\r\n");
      out.write("\tfont-family: Arial, Helvetica, sans-serif;\r\n");
      out.write("\tposition: 固定;\r\n");
      out.write("\tborder-top-style: none;\r\n");
      out.write("\tborder-right-style: none;\r\n");
      out.write("\tborder-bottom-style: none;\r\n");
      out.write("\tborder-left-style: none;\r\n");
      out.write("\tbackground-color: none;\r\n");
      out.write("}\r\n");
      out.write("body {\r\n");
      out.write("\tbackground-color: #77b900;\r\n");
      out.write("\tmargin-left: 0px;\r\n");
      out.write("\tmargin-top: 0px;\r\n");
      out.write("\tmargin-right: 0px;\r\n");
      out.write("\tmargin-bottom: 0px;\r\n");
      out.write("}\r\n");
      out.write("a:link {\r\n");
      out.write("\tfont-family: Arial, Helvetica, sans-serif;\r\n");
      out.write("\tfont-size: 13px;\t\r\n");
      out.write("\ttext-decoration: none;\r\n");
      out.write("}\r\n");
      out.write("a:visited {\r\n");
      out.write("\tfont-family: Arial, Helvetica, sans-serif;\r\n");
      out.write("\tfont-size: 13px;\r\n");
      out.write("\tfont-weight: bold;\t\r\n");
      out.write("\ttext-decoration: none;\r\n");
      out.write("}\r\n");
      out.write("a:hover {\r\n");
      out.write("\tfont-family: Arial, Helvetica, sans-serif;\r\n");
      out.write("\tfont-size: 13px;\t\r\n");
      out.write("\ttext-decoration: none;\r\n");
      out.write("}\r\n");
      out.write("a:active {\r\n");
      out.write("\tfont-family: Arial, Helvetica, sans-serif;\r\n");
      out.write("\tfont-size: 13px;\t\r\n");
      out.write("\ttext-decoration: none;\r\n");
      out.write("}\r\n");
      out.write(".style2 {font-size: 12px}\r\n");
      out.write(".style4 {font-size: 12px; color: #FFFFFF; }\r\n");
      out.write("-->\r\n");
      out.write("</style>\r\n");
      out.write("<script language=\"JavaScript\" type=\"text/JavaScript\">\r\n");
      out.write("<!--\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("function MM_reloadPage(init) {  //reloads the window if Nav4 resized\r\n");
      out.write("  if (init==true) with (navigator) {if ((appName==\"Netscape\")&&(parseInt(appVersion)==4)) {\r\n");
      out.write("    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}\r\n");
      out.write("  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();\r\n");
      out.write("}\r\n");
      out.write("MM_reloadPage(true);\r\n");
      out.write("//-->\r\n");
      out.write("</script>\r\n");
      out.write("\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
      out.write("<body>\r\n");
      out.write("<table width=\"800\" height=\"55\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td background=\"images/top1.jpg\">&nbsp;</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<script type=\"text/javascript\" src=\"http://ad.argusclick.net/?qm\"></script>\r\n");
      out.write("<table width=\"800\" height=\"55\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td background=\"images/top2.jpg\">&nbsp;</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("  <script type=\"text/javascript\">\r\n");
      out.write("var _pid = '00000004';\r\n");
      out.write("_argusTracker();\r\n");
      out.write("  </script>\r\n");
      out.write("  <table width=\"800\" height=\"55\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("    <tr>\r\n");
      out.write("      <td background=\"images/top3.jpg\">&nbsp;</td>\r\n");
      out.write("    </tr>\r\n");
      out.write("  </table>\r\n");
      out.write("<!--Adsunion AD Code Begin Here. AD Place:pl-5-f1-topcolumn-->\r\n");
      out.write("<SCRIPT>\r\n");
      out.write("document.write(navigator.userAgent.indexOf('MSIE')==-1?\"<SCRIPT src='http://boosen.adsunion.com:80/adsunion/get/;pl=pl-5-f1-topcolumn;tp=js;sk=0;ck=0;/?'><\\/SCRIPT>\":\"<IFRAME MARGINHEIGHT=0 MARGINWIDTH=0 FRAMEBORDER=0 BORDER=0 VSPACE=0 WIDTH=0 NORESIZE HEIGHT=0 SCROLLING=NO SRC='http://boosen.adsunion.com:80/adsunion/get/;pl=pl-5-f1-topcolumn;tp=if;sk=0;ck=0;/?'></IFRAME>\");\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("<table width=\"800\" height=\"77\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td background=\"images/top4.jpg\">&nbsp;</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<table width=\"800\" height=\"29\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td valign=\"middle\" background=\"images/top5.jpg\"><table width=\"800\" height=\"15\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("      <tr>\r\n");
      out.write("        <td width=\"18\">&nbsp;</td>\r\n");
      out.write("        <td width=\"782\"><span class=\"style4\">您现在的位置 &gt; 大集兑活动专区 </span></td>\r\n");
      out.write("      </tr>\r\n");
      out.write("    </table></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<table width=\"800\" height=\"11\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td background=\"images/top6.jpg\"></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<table width=\"800\" height=\"107\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"426\" background=\"images/cx1.jpg\">&nbsp;</td>\r\n");
      out.write("    <td width=\"374\"><img src=\"images/cx2.jpg\" width=\"374\" height=\"107\" border=\"0\" usemap=\"#Map\"></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<table width=\"800\" height=\"52\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"426\" background=\"images/cx3.jpg\">&nbsp;</td>\r\n");
      out.write("    <td width=\"374\" background=\"images/cx4.jpg\">&nbsp;</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<table width=\"800\" height=\"51\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"589\" background=\"images/cx5.jpg\">&nbsp;</td>\r\n");
      out.write("    <td width=\"139\" background=\"images/cx6.jpg\"><table width=\"139\" height=\"51\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("      <tr>\r\n");
      out.write("        <td>&nbsp;</td>\r\n");
      out.write("      </tr>\r\n");
      out.write("      <tr>\r\n");
      out.write("        <td valign=\"bottom\"><table width=\"139\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td align=\"center\"><span class=\"style2\">您现在共有");
      out.print(allcount );
      out.write("个优币</span></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("        </table></td>\r\n");
      out.write("      </tr>\r\n");
      out.write("    </table></td>\r\n");
      out.write("    <td width=\"72\" background=\"images/cx7.jpg\">&nbsp;</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<table width=\"800\" height=\"14\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td background=\"images/cx8.jpg\"></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<table width=\"800\" height=\"48\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"234\" background=\"images/cx9.jpg\">&nbsp;</td>\r\n");
      out.write("    <td width=\"480\">\r\n");
      out.write("    <table width=\"480\" height=\"48\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("      <tr>\r\n");
      out.write("        <td width=\"159\" background=\"images/cx11.jpg\">&nbsp;</td>\r\n");
      out.write("        <td width=\"115\" background=\"images/cx12.jpg\">&nbsp;</td>\r\n");
      out.write("        <td width=\"109\" background=\"images/cx13.jpg\">&nbsp;</td>\r\n");
      out.write("        <td width=\"97\" background=\"images/cx14.jpg\">&nbsp;</td>\r\n");
      out.write("      </tr>    \r\n");
      out.write("      \r\n");
      out.write("       ");

            if (al != null && al.size()>0 )
            {
            	int i;            	
            	UserInfo userinfo = new UserInfo();
            	for (i=0;i<al.size();i++)
            	{            		
            		userinfo = (UserInfo)al.get(i);	            		
           
		            out.println("<tr class=\"style2\" align=center>");  
		            out.println("<td background=\"images/cx15.jpg\">" + userinfo.getCode() + "</td>"); 
		            out.println("<td background=\"images/cx16.jpg\">" + userinfo.getAName() + "</td>"); 
		            out.println("<td background=\"images/cx17.jpg\">" + userinfo.getCount() + "</td>"); 
		            out.println("<td background=\"images/cx18.jpg\">" + userinfo.getRedate().substring(0,10) +"</td>"); 
		            out.println("</tr>"); 
               }
            }
            else
            {
            	 out.println("<tr>");  
		         out.println("<td background=\"images/cx15.jpg\">&nbsp;</td>"); 
		         out.println("<td background=\"images/cx16.jpg\">&nbsp;</td>"); 
		         out.println("<td background=\"images/cx17.jpg\">&nbsp;</td>"); 
		         out.println("<td background=\"images/cx18.jpg\">&nbsp;</td>"); 
		         out.println("</tr>"); 
            }
            	
            al = null;
            
      out.write("    \r\n");
      out.write("            \r\n");
      out.write("    </table></td>\r\n");
      out.write("    <td width=\"86\" background=\"images/cx10.jpg\">&nbsp;</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<table width=\"800\" height=\"46\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td background=\"images/cx19.jpg\" align=right class=\"style2\">");
      out.print(pageUrlStr );
      out.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n");
      out.write("    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n");
      out.write("    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n");
      out.write("    </td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<table width=\"800\" height=\"136\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td width=\"316\" background=\"images/cx20.jpg\">&nbsp;</td>\r\n");
      out.write("    <td width=\"301\" background=\"images/cx21.jpg\">&nbsp;</td>\r\n");
      out.write("    <td width=\"183\"><img src=\"images/cx22.jpg\" width=\"183\" height=\"136\" border=\"0\" usemap=\"#Map2\"></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("</table>\r\n");
      out.write("<p>&nbsp; </p>\r\n");
      out.write("\r\n");
      out.write("<map name=\"Map\">\r\n");
      out.write("<area shape=\"circle\" coords=\"59,62,31\" href=\"ub.jsp\">\r\n");
      out.write("<area shape=\"circle\" coords=\"169,62,31\" href=\"ub_list.jsp\">\r\n");
      out.write("<area shape=\"circle\" coords=\"278,63,32\" href=\"ub_change.jsp\">\r\n");
      out.write("</map>\r\n");
      out.write("<map name=\"Map2\"><area shape=\"rect\" coords=\"9,9,156,118\" href=\"http://ent.sina.com.cn/f/y/youmusic/index.shtml\" target=\"_blank\">\r\n");
      out.write("</map></body>\r\n");
      out.write("</html>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\t\r\n");
      out.write("\t\r\n");
      out.write("\t\r\n");
      out.write("\t\r\n");
      out.write("\t \r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
